An extraordinary WebInput.NET features which can define input expression, limiting input, validating input and spinning selected input text. Following standard masking mechanism, it brings versatile and powerful editing feature to WebInput.NET.
When you create an input mask, you can use special characters to acquire that certain data to be entered (for example, the area code for a phone number) and that other data is optional (such as a telephone extension). These characters specify the type of data, such as a number or character, that you must enter for each character in the input mask.
When you type data in a field for which you've defined an input mask, the data is always entered in Overtype mode. If you use the BACKSPACE key to delete a character, the character is replaced by a PromptChar character.
Masking in WebInput.NET modes
- Basic Mode
There is no masking applied.
- Display Mode
There is no masking applied.
- Edit Mode
There is no masking applied.
- Display and Edit Mode
There is no masking applied.
Masking and data type
- MaskType.DateTime
- Requires the EditFormat.MaskInfo.MaskExpression.
- Requires the EditFormat.Format expression (must be synchronized with the EditFormat.MaskInfo.MaskExpression).
- Auto short (ddd) and long (dddd) day name fill with first month name character.
- Auto short (MMM) and long (MMMM) month name fill with first month name character.
- Supports spinning value.
- HighLightType.Phrase is recommended to be used.
- MaskType.Number
- Requires the EditFormat.MaskInfo.MaskExpression.
- Requires the EditFormat.Format expression (must be synchronize with the EditFormat.MaskInfo.MaskExpression).
- Supports spinning value.
- HighLightType.Character is recommended to be used.
- MaskType.DynamicNumber
- Does not require the EditFormat.MaskInfo.MaskExpression.
- Requires the EditFormat.Format expression.
- Special behavior of number masking with no predefined placeholder.
- Does not support spinning value.
- Does not support highlighting.
- MaskType.Other
- Requires the EditFormat.MaskInfo.MaskExpression.
- Does not require the EditFormat.Format expression.
- Supports spinning value.
- HighLightType.Character is recommended to be used.
![]() |
MaskType.DynamicNumber doesn't use mask expression, it used format expression (no predefined placeholder) |
![]() |
MaskType.Other only supports string data type. |
Supported masking character
Masking Character | Description |
0 | Digit (0 to 9, entry required, plus [+] and minus [-] signs not allowed). |
9 | Digit or space (entry not required, plus and minus signs not allowed). |
# | Digit or space (entry not required; spaces are displayed as blanks while in Edit mode, but blanks are removed when data is saved; plus and minus signs allowed). |
L | Letter (A to Z, entry required). |
? | Letter (A to Z, entry optional). |
A | Letter or digit (entry required). |
a | Letter or digit (entry optional). |
& | Any character or a space (entry required). |
C | Any character or a space (entry optional). |
. , : ; - / | Decimal placeholder and thousand, date and time separator. Separator: A character that separates units of text or numbers. The actual character used depends on the settings in the Regional Settings Properties dialog box in Windows Control Panel. |
< | Causes all character to be converted to lowercase. |
> | Causes all character to be converted to uppercase. |
Other character | Displays as literal character. |
Unsupported masking character
Masking Character
Description
!
Causes the input mask to display from right to left instead of left to right. Character typed into the mask is always filled from left to right. You can include the exclamation point anywhere in the input mask.
\
Causes the character displayed as the literal character (for example, \A is displayed as just A).
Password
Creates a password-entry control. Any character typed in the control is stored as the character but it is displayed as an asterisk (*). You use the Password input mask to prevent displaying the typed character on the screen.
Example
The following table shows some useful input masks and type of values you can use:
Input mask | Sample values |
(000) 000-0000 | (206) 555-0248 |
(999) 999-9999 | (206) 555-0248 ( ) 555-0248 |
(000) AAA-AAAA | (206) 555-TELE |
#999 | "20 2000 |
>L????L?000L0 | GREENGR339M3 MAY R 452B7 |
>L0L 0L0 | T2F 8M4 |
00000-9999 | 98115- 98115-3007 |
>L<?????????????? | Maria Brendan |
SSN 000-00-0000 | SSN 555-55-5555 |
>LL00000-0000 | DB51392-0493 |
![]() |
When you have inputted mask that used optional masking character such as # or 9, the editing behavior will skip the optional entry by default and focus the highlight to the next text object. To prevent this skip behavior, set the SkipOptional property to false. |
In This Section
How-to: Perform masking data using phone number format
How-to: Perform masking data using social security number format
How-to: Perform masking data using zip code format
How-to: Perform masking data using extension number format
How-to: Perform masking data using VAT number format